package com.bupt.enums;


/**
 * @author 阿甘
 * @version 1.0
 * 注：如有任何疑问欢迎加入QQ群977438372 进行讨论
 * @see https://study.163.com/course/courseMain.htm?courseId=1004348001&share=2&shareId=1016671292
 */
public enum ResultCode {

    /* 成功状态码 */
    SUCCESS(0, "成功"),

    /* 系统500错误*/
    SYSTEM_ERROR(5000, "系统异常，请稍后重试"),
    SYSTEM_BUSY(5001, "系统繁忙，请稍后再试"),


    /* 参数错误 */
    PARAM_IS_INVALID(1001, "参数无效"),
    MISSING_IMPORTANT_PARAM(1002,"缺少重要参数"),


    /* 用户错误：20001-29999*/
    USER_LOGIN_FAIL(2001, "用户名或密码错误"),
    USER_NOT_LOGIN(2002, "请先登录"),
    SESSION_LOGIN_FAIL(2003, "请重新登录"),

    NOT_IN_FILM_SHOWRANGE(2004,"不在放映期内"),
    FILM_NOT_SHOW_IN_HALL(2005,"该电影不在此影厅中放映"),
    TIME_PERIOD_NOT_FOUND(2006,"此时段没有电影场次"),
    TICKETS_EXCEED_LIMIT(2007, "票数最多是4张"),
    NOT_ENOUGH_TICKETS(2008,"剩余电影票不够"),
    HALL_NOT_FOUND(2009,"没有此影厅"),
    FILM_NOT_FOUND(2010,"没有此电影"),
    USER_SESSION_NOT_MATCH(2011, "session登录信息不一致");

    private Integer code;

    private String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer code() {
        return this.code;
    }

    public String message() {
        return this.message;
    }

    }
